package com.moody.util;

public class FormatUtil {

	 /** 
	  * 判断字符串是否是浮点数 
	  */  
	 public static boolean isDouble(String value) {  
	     try {  
	         Double.parseDouble(value);  
	         if (value.contains("."))  
	             return true;  
	         return false;  
	     } catch (NumberFormatException e) {  
	         return false;  
	     }  
	 } 
	 /** 
	  * 判断字符串是否是正数 
	  */  
	 public static boolean isInteger(String value) {  
	     try {  
	         Integer.parseInt(value);  
	         if (!value.contains("."))  
	             return true;  
	         return false;  
	     } catch (NumberFormatException e) {  
	         return false;  
	     }  
	 } 
}
